package com.zf.shuashua.ui.popup;

import android.content.Context;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.CenterPopupView;
import com.zf.shuashua.R;

/**
 * 开启通知奖励弹窗
 */
public class OpenNoticePopup extends CenterPopupView {
    private OnPopupListener mListener;
    private String value;
    private String title;
    private TextView tvSum;
    private TextView tvTitle;

    public OpenNoticePopup(@NonNull Context context, String value, String title) {
        super(context);
        this.value = value;
        this.title = title;
    }

    public void setPopupListener(OnPopupListener listener) {
        this.mListener = listener;
    }

    @Override
    protected int getImplLayoutId() {
        return R.layout.pupop_open_notice;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        tvSum = findViewById(R.id.tvSum);
        tvTitle = findViewById(R.id.tvTitle);
        tvTitle.setText(title);
        tvSum.setText(value);
        findViewById(R.id.img_close).setOnClickListener(view -> dismiss());

        findViewById(R.id.tv_next).setOnClickListener(v -> {
            if (mListener != null) {
                mListener.onNext();
            }
        });
    }

}

